package base

import (
	"context"
	"github.com/gogf/gf/v2/util/gconv"
	"rewords-server-2024/internal/library/cache"

	"rewords-server-2024/api/base/cacheAPI"
)

func (c *ControllerCacheAPI) DataList(ctx context.Context, req *cacheAPI.DataListReq) (res *cacheAPI.DataListRes, err error) {
	//return nil, gerror.NewCode(gcode.CodeNotImplemented)
	//result, err := cache.Instance().Data(ctx)
	result, err := cache.Instance().Size(ctx)
	res = &cacheAPI.DataListRes{
		Data:  nil,
		Total: gconv.Int(result),
	}
	return
}
